import pymysql

db = pymysql.connect(
    host='localhost',
    port=3306,
    database='jiangsu',
    user='root',
    password='root',
    charset='utf8'
)

cursor = db.cursor()
sql = "update student set s_name = '尼克斯' where s_id = '10'"
cursor.execute(sql)
db.commit()  # 提交事务

# 关闭链接
cursor.close()
db.close()
